package com.jiayinlending.retrofit;

import com.jiayinlending.retrofit.api.HomeApi;
import com.jiayinlending.retrofit.api.MineApi;
import com.jiayinlending.retrofit.api.RepaymentApi;

/**
 * Created by yuexiaohui on 2017/5/5 17:46
 */

public class JiaYinDaiFactory {

    protected static final Object monitor = new Object();
    static HomeApi sHomeApi = null;
    static MineApi sMineApi = null;
    static RepaymentApi sRepaymentApi = null;

    public static final boolean isDebug = true;

    public static HomeApi getHomeApiSingleton() {
        synchronized (monitor) {
            if (sHomeApi == null) {
                sHomeApi = new JiaYinDaiRetrofit().getHomeApi();
            }
            return sHomeApi;
        }
    }

    public static RepaymentApi getRepaymentApiSingleton() {
        synchronized (monitor) {
            if (sRepaymentApi == null) {
                sRepaymentApi = new JiaYinDaiRetrofit().getRepaymentApi();
            }
            return sRepaymentApi;
        }
    }


    public static MineApi getMineApiSingleton() {
        synchronized (monitor) {
            if (sMineApi == null) {
                sMineApi = new JiaYinDaiRetrofit().getMineApi();
            }
            return sMineApi;
        }
    }
}
